package com.zoro.barn.commons.mongodb.config;

import com.zoro.barn.commons.mongodb.dao.MongoDao;
import com.zoro.barn.commons.mongodb.property.BarnMongoProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

/**
 * @author zhaoxingwu
 */
@ComponentScan("com.zoro.barn.barnmongocommon")
@EnableConfigurationProperties(BarnMongoProperties.class)
public class MongoConfig {


    @Bean
    public MongoDao mongoDao(@Autowired BarnMongoProperties properties) {
        return new MongoDao(properties);
    }
}
